<?if(!$this->mainPage):?>
    <h3>Очередь покупок</h3>
<?endif;?>
<table class="table table-hover">
    <? foreach ($this->topGoods as $good):?>
    <?/** @var $good Application_Model_Buy */?>
    <tr>
        <td class="good-name" onclick="buy.getForm(<?=$good->getBuyId()?>)"><?= $good->getBuyName() ?></td>
        <td>
            <?if (!$this->mainPage): ?>
                <? if ($good->getBuyStatus() < Application_Model_Buy::MAX_PRIORITY):?>
                    <i title="Поднять приоритет"  class="icon-arrow-up"    onclick="buy.upTop(<?=$good->getBuyId()?>)"></i>
                <? endif; ?>
                <? if ($good->getBuyStatus() != Application_Model_Buy::MIN_PRIORITY):?>
                    <i title="Опустить приоритет" class="icon-arrow-down"  onclick="buy.downTop(<?=$good->getBuyId()?>)"></i>
                <? endif; ?>
            <? else: ?>
                <i title="В дайджест" class="icon-eye-open" onclick="mn.addThing(<?=$good->getBuyId()?>, <?= Application_Model_Thing::TYPE_BUY ?>, $('#term-id-<?= $good->getBuyId(); ?>'));"></i>
            <? endif; ?>
            <i title="Удалить из топа"    class="icon-thumbs-down" onclick="buy.deleteFromTop(<?=$good->getBuyId()?>, this)"></i>
            <i title="Удалить"            class="icon-trash"       onclick="buy.deleteBuy(<?=$good->getBuyId()?>);"></i>
        </td>
    </tr>
    <? endforeach; ?>
</table>
